package vue;

import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import modele.Drapeau;
import modele.Joueur;
import modele.Plateau;
import modele.case_.Case;
import modele.epoque.Epoque;
import modele.mode.Mode;
import modele.mode.ex.ModeInexistant;
import outils.ImageOutils;
import outils.gestionnairefichier.GestionnaireImage;
import outils.gestionnairefichier.GestionnairePlateau;

/**
 *
 * @author twane
 */
public class FenetreChoix extends javax.swing.JFrame {

	private Plateau plateau;

	/**
	 * Creates new form FenetreChoix
	 */
	public FenetreChoix() {
		setUndecorated(true);
		setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize());
		initComponents();
		try {
			afficherApercuMap("src/donnees/maps/map1", Mode.getModeNom(modeGroup.getSelection().getActionCommand()));
		} catch (ModeInexistant ex) {
			Logger.getLogger(FenetreChoix.class.getName()).log(Level.SEVERE, null, ex);
		}
	}

	private void afficherApercuMap(String cheminMap, Mode mode) {
		Point tailleApercu = new Point(apercuMap.getWidth(), apercuMap.getHeight());
		plateau = GestionnairePlateau.getInstance().get(cheminMap).copier();
		plateau.setMode(mode);
		BufferedImage bufferCarte = new BufferedImage(plateau.getLargeur() * Plateau.TAILLE_CASE, plateau.getHauteur() * Plateau.TAILLE_CASE, BufferedImage.TYPE_INT_ARGB);
		BufferedImage bufferApercu = new BufferedImage(tailleApercu.x, tailleApercu.y, BufferedImage.TYPE_INT_ARGB);

		Graphics2D g2 = (Graphics2D) bufferCarte.createGraphics();
		Graphics2D gApercu = bufferApercu.createGraphics();

		Joueur joueur1 = new Joueur(1, (Epoque) null);
		Joueur joueur2 = new Joueur(2, (Epoque) null);

		BufferedImage imageCasePositionnable = GestionnaireImage.getInstance().get("src/donnees/images/selectionbleue.png");
		imageCasePositionnable = ImageOutils.copyAlpha(imageCasePositionnable, 0.2f);

		for (int x = 0; x < plateau.getLargeur(); x++) {
			for (int y = 0; y < plateau.getHauteur(); y++) {
				colorierCase(x, y, bufferCarte);

				if (plateau.isPositionnable(new Point(x, y), joueur1)
						|| plateau.isPositionnable(new Point(x, y), joueur2)) {
					g2.drawImage(imageCasePositionnable, null, x * Plateau.TAILLE_CASE, y * Plateau.TAILLE_CASE);
				}
			}
		}

		for (Drapeau drapeau : plateau.getDrapeaux()) {
			drapeau.dessiner(g2, null);
		}

		double scale;
		int moveX = 0;
		int moveY = 0;
		if (bufferCarte.getWidth() < bufferCarte.getHeight()) {
			scale = (float) tailleApercu.y / bufferCarte.getHeight();
			moveX = (int) (tailleApercu.x - (scale * bufferCarte.getWidth())) / 2;
		} else {
			scale = (float) tailleApercu.x / bufferCarte.getWidth();
			moveY = (int) (tailleApercu.y - (scale * bufferCarte.getHeight())) / 2;
		}

		AffineTransform tx = new AffineTransform();
		tx.setTransform(scale, 0, 0, scale, moveX, moveY);
		gApercu.drawImage(bufferCarte, tx, null);

		JLabel picLabel = new JLabel(new ImageIcon(bufferApercu));
		apercuMap.removeAll();
		ImageOutils.ajouterJLabelPanel(apercuMap, picLabel);

	}

	private void colorierCase(int x, int y, BufferedImage bufferCarte) {
		Graphics2D g2 = (Graphics2D) bufferCarte.createGraphics();
		Case c1 = plateau.getCase(x, y);
		BufferedImage image = GestionnaireImage.getInstance().get(c1.getImage());
		g2.drawImage(image, null, x * Plateau.TAILLE_CASE + 1, y * Plateau.TAILLE_CASE + 1);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        groupJ1 = new javax.swing.ButtonGroup();
        groupJ2 = new javax.swing.ButtonGroup();
        modeGroup = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        BoutonQuitter = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        mapComboBox = new javax.swing.JComboBox();
        apercuMap = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        bDrapeau = new javax.swing.JRadioButton();
        bAMort = new javax.swing.JRadioButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        bMedievalJ1 = new javax.swing.JRadioButton();
        bPresentJ1 = new javax.swing.JRadioButton();
        bFuturJ1 = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();
        bMedievalJ2 = new javax.swing.JRadioButton();
        bPresentJ2 = new javax.swing.JRadioButton();
        bFuturJ2 = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        placementAuto = new javax.swing.JCheckBox();
        bValider = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        BoutonQuitter.setIcon(new javax.swing.ImageIcon(getClass().getResource("/donnees/images/Croix.png"))); // NOI18N
        BoutonQuitter.setBorder(null);
        BoutonQuitter.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        BoutonQuitter.setFocusable(false);
        BoutonQuitter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BoutonQuitterActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setFocusable(false);

        mapComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "map1", "map2", "map3", "map4", "map5", "map6", "map7" }));
        mapComboBox.setFocusable(false);
        mapComboBox.setRequestFocusEnabled(false);
        mapComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mapComboBoxActionPerformed(evt);
            }
        });

        apercuMap.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        apercuMap.setPreferredSize(new java.awt.Dimension(300, 300));

        javax.swing.GroupLayout apercuMapLayout = new javax.swing.GroupLayout(apercuMap);
        apercuMap.setLayout(apercuMapLayout);
        apercuMapLayout.setHorizontalGroup(
            apercuMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 298, Short.MAX_VALUE)
        );
        apercuMapLayout.setVerticalGroup(
            apercuMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 298, Short.MAX_VALUE)
        );

        jLabel3.setText("Choix de la carte");

        modeGroup.add(bDrapeau);
        bDrapeau.setSelected(true);
        bDrapeau.setText("Drapeau");
        bDrapeau.setFocusable(false);
        bDrapeau.setActionCommand("Drapeau");
        bDrapeau.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAMortActionPerformed(evt);
            }
        });

        modeGroup.add(bAMort);
        bAMort.setText("A mort");
        bAMort.setFocusable(false);
        bAMort.setActionCommand("A Mort");
        bAMort.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAMortActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(mapComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(bDrapeau)
                        .addGap(18, 18, 18)
                        .addComponent(bAMort))
                    .addComponent(apercuMap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addContainerGap(46, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(mapComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bDrapeau)
                    .addComponent(bAMort))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(apercuMap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setFocusable(false);

        jLabel1.setText("Joueur 1");

        groupJ1.add(bMedievalJ1);
        bMedievalJ1.setSelected(true);
        bMedievalJ1.setText("Médiéval");
        bMedievalJ1.setFocusable(false);
        bMedievalJ1.setActionCommand("Medieval");

        groupJ1.add(bPresentJ1);
        bPresentJ1.setText("Présent");
        bPresentJ1.setFocusable(false);
        bPresentJ1.setActionCommand("Present");

        groupJ1.add(bFuturJ1);
        bFuturJ1.setText("Futur");
        bFuturJ1.setFocusable(false);
        bFuturJ1.setActionCommand("Futur");

        jLabel2.setText("Joueur 2");

        groupJ2.add(bMedievalJ2);
        bMedievalJ2.setSelected(true);
        bMedievalJ2.setText("Médiéval");
        bMedievalJ2.setFocusable(false);
        bMedievalJ2.setActionCommand("Medieval");

        groupJ2.add(bPresentJ2);
        bPresentJ2.setText("Présent");
        bPresentJ2.setFocusable(false);
        bPresentJ2.setActionCommand("Present");

        groupJ2.add(bFuturJ2);
        bFuturJ2.setText("Futur");
        bFuturJ2.setFocusable(false);
        bFuturJ2.setActionCommand("Futur");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(bMedievalJ1)
                    .addComponent(bPresentJ1)
                    .addComponent(bFuturJ1))
                .addGap(72, 72, 72)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bFuturJ2)
                    .addComponent(bPresentJ2)
                    .addComponent(bMedievalJ2)
                    .addComponent(jLabel2))
                .addContainerGap(98, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bMedievalJ1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bPresentJ1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bFuturJ1))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bMedievalJ2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bPresentJ2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bFuturJ2))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        placementAuto.setSelected(true);
        placementAuto.setText("Placement automatique des pions");
        placementAuto.setFocusable(false);

        bValider.setText("Valider");
        bValider.setSelected(true);
        bValider.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bValiderActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bValider)
                    .addComponent(placementAuto))
                .addContainerGap(79, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(placementAuto)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bValider)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(507, 507, 507)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(163, 163, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(994, Short.MAX_VALUE)
                .addComponent(BoutonQuitter)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(BoutonQuitter)
                .addGap(57, 57, 57)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(26, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BoutonQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BoutonQuitterActionPerformed
		dispose();
		System.exit(0);
    }//GEN-LAST:event_BoutonQuitterActionPerformed

    private void mapComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mapComboBoxActionPerformed
		JComboBox cb = (JComboBox) evt.getSource();
		String mapName = (String) cb.getSelectedItem();
		try {
			afficherApercuMap("src/donnees/maps/" + mapName, Mode.getModeNom(modeGroup.getSelection().getActionCommand()));
		} catch (ModeInexistant ex) {
			Logger.getLogger(FenetreChoix.class.getName()).log(Level.SEVERE, null, ex);
		}
    }//GEN-LAST:event_mapComboBoxActionPerformed

    private void bValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bValiderActionPerformed
		dispose();
		String commandeJ1 = groupJ1.getSelection().getActionCommand();
		String commandeJ2 = groupJ2.getSelection().getActionCommand();
		Mode mode = null;
		try {
			mode = Mode.getModeNom(modeGroup.getSelection().getActionCommand());

		} catch (ModeInexistant ex) {
			Logger.getLogger(FenetreChoix.class.getName()).log(Level.SEVERE, null, ex);
		}

		new Fenetre((String) mapComboBox.getSelectedItem(), commandeJ1, commandeJ2, placementAuto.isSelected(), mode).setVisible(true);
    }//GEN-LAST:event_bValiderActionPerformed

	private void bAMortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAMortActionPerformed
		String mapName = (String) mapComboBox.getSelectedItem();
		try {
			afficherApercuMap("src/donnees/maps/" + mapName, Mode.getModeNom(modeGroup.getSelection().getActionCommand()));
		} catch (ModeInexistant ex) {
			Logger.getLogger(FenetreChoix.class.getName()).log(Level.SEVERE, null, ex);
		}
	}//GEN-LAST:event_bAMortActionPerformed

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		/* Set the Nimbus look and feel */
		//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
		 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(FenetreChoix.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(FenetreChoix.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(FenetreChoix.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(FenetreChoix.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		}
		//</editor-fold>

		/* Create and display the form */
		java.awt.EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				new FenetreChoix().setVisible(true);
			}
		});
	}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BoutonQuitter;
    private javax.swing.JPanel apercuMap;
    private javax.swing.JRadioButton bAMort;
    private javax.swing.JRadioButton bDrapeau;
    private javax.swing.JRadioButton bFuturJ1;
    private javax.swing.JRadioButton bFuturJ2;
    private javax.swing.JRadioButton bMedievalJ1;
    private javax.swing.JRadioButton bMedievalJ2;
    private javax.swing.JRadioButton bPresentJ1;
    private javax.swing.JRadioButton bPresentJ2;
    private javax.swing.JButton bValider;
    private javax.swing.ButtonGroup groupJ1;
    private javax.swing.ButtonGroup groupJ2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JComboBox mapComboBox;
    private javax.swing.ButtonGroup modeGroup;
    private javax.swing.JCheckBox placementAuto;
    // End of variables declaration//GEN-END:variables
}
